<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: register.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."register.php";
include LOCALE.LOCALESET."user_fields.php";

$db_host = "localhost";
$username="root";
$password="";
$database="landbrukstjenesten";

mysql_connect($db_host,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM avloser";
$result=mysql_query($query);

$num=mysql_numrows($result);



echo "<form action='ny.php' method='post'>";
echo "<table cellpadding='0' cellspacing='0' class='center'>\n<tr>\n";
echo "<td class='tbl'>".$locale['u001']."<span style='color:#ff0000'>*</span></td>\n";
echo "<td class='tbl'><input type='text' name='fornavn' maxlength='30' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>".$locale['u002']."<span style='color:#ff0000'>*</span></td>\n";
echo "<td class='tbl'><input type='text' name='etternavn' maxlength='20' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>".$locale['u003']."<span style='color:#ff0000'>*</span></td>\n";
echo "<td class='tbl'><input type='text' name='adresse' maxlength='30' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>".$locale['u004']."<span style='color:#ff0000'>*</span></td>\n";
echo "<td class='tbl'><input type='text' name='postnr' maxlength='30' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>".$locale['u005']."<span style='color:#ff0000'>*</span></td>\n";
echo "<td class='tbl'><input type='text' name='telefon' maxlength='30' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>".$locale['u006']."<span style='color:#ff0000'>*</span></td>\n";
echo "<td class='tbl'><input type='text' name='mobil' maxlength='30' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>".$locale['u007']."<span style='color:#ff0000'>*</span></td>\n";
echo "<td class='tbl'><input type='text' name='epost' maxlength='30' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<input type='Submit'>";
echo "</form>";



mysql_close();

echo "<b><center>Database Output</center></b><br><br>";
echo "<table border='0' cellpadding='5'>
<tr>
<td><b>Fornavn</b></td>
<td><b>Etternavn</b></td>
<td>Adresse</td>
<td>Postnr</td>
<td>Telefon</td>
<td>Mobil</td>
<td>Epost</td>
</tr>";


$i=0;
while ($i < $num) {

$fornavn=mysql_result($result,$i,"fornavn");
$etternavn=mysql_result($result,$i,"etternavn");
$adresse=mysql_result($result,$i,"adresse");
$postnr=mysql_result($result,$i,"postnr");
$telefon=mysql_result($result,$i,"telefon");
$mobil=mysql_result($result,$i,"mobil");
$epost=mysql_result($result,$i,"epost");






echo " 

<tr>
<td>$fornavn</td>
<td>$etternavn</td>
<td>$adresse</td>
<td>$postnr</td>
<td>$telefon</td>
<td>$mobil</td>
<td>$epost</td>
</tr>";


$i++;
}
echo " </table>";

require_once THEMES."templates/footer.php";
?>
